<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .big{
            /* 有白边8px */
            background-color: red;
            width: 600px;
            height: 600px;
        }
        .box{
            background-color: green;
            width: 300px;
            height: 300px;
            position: relative;
        }
        .inner{
            background-color: purple;
            width: 100px;
            height: 100px;
            /* 1.还原,static不会对top,left,bottom,right生效 */
            /* 2. relative 相对于自己 */
            /* 3.absolute 参照目标找带有定位的父元素(就近原则),如果父级们都没有定位,默认找body */
            position: absolute;
            left:100px;
        }
    </style>
</head>
<body>
    <div class="big">
        <div class="box">
            <div class="inner"></div>
        </div>
    </div>
</body>
</html>